//
//  YDBaseController.m
//  YDRACLearn
//
//  Created by rowena on 2019/1/9.
//  Copyright © 2019年 wuyezhiguhun. All rights reserved.
//

#import "YDBaseController.h"

@interface YDBaseController ()
@property (nonatomic, strong) UIImageView *backgroundImageView;
@end

@implementation YDBaseController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self addAllViews];
    [self setAllViewsLayout];
    // Do any additional setup after loading the view.
}

#pragma mark ==== 添加所有的View ====
/**
 * 添加所有的View
 */
- (void)addAllViews {
    [self.view addSubview:self.backgroundImageView];
}
#pragma mark ==== 设置所有的View UI布局 ====
/**
 * 设置所有的View UI布局
 */
- (void)setAllViewsLayout {
    [self.backgroundImageView autoPinEdgeToSuperviewEdge:ALEdgeTop];
    [self.backgroundImageView autoPinEdgeToSuperviewEdge:ALEdgeLeft];
    [self.backgroundImageView autoPinEdgeToSuperviewEdge:ALEdgeRight];
    [self.backgroundImageView autoPinEdgeToSuperviewEdge:ALEdgeBottom];
}

#pragma mark ==== get 函数 ====
- (UIImageView *)backgroundImageView {
    if (!_backgroundImageView) {
        _backgroundImageView = [[UIImageView alloc] initWithImage:[[UIImage imageNamed:@"base_background"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    }
    return _backgroundImageView;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
